package com.version.manager.service.Shop;

import com.version.manager.entity.Shop.shopGoodsColor;
import com.version.manager.entity.Shop.shopGoodsSize;
import com.version.manager.mapper.Shop.shopGoodsSizeMapper;
import com.version.manager.model.Msg;
import com.version.manager.service.BaseService;
import com.version.manager.util.QueryParam;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
@Transactional(rollbackFor = Exception.class)
public class ShopGoodsSizeService extends BaseService<shopGoodsSizeMapper, shopGoodsSize> {
    @Cacheable(value = "goodsSize",key = "'goodsSize_'.concat(#root.args[0])",sync=true)
    public Msg goodsSize(String goodsId){
        Map<String,Object> map=new HashMap<>();
        map.put("goodsId",goodsId);
        QueryParam queryParam=new QueryParam(map);
        List<shopGoodsSize> data=super.selectList(queryParam);
        return Msg.success().addData(data);
    }
}
